package com.mdlib.droid.module.user.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.mdlib.droid.base.BaseCommonActivity;
import com.mdlib.droid.base.BaseFragment;
import com.mdlib.droid.common.JumpType;
import com.mdlib.droid.module.UIHelper;
import com.mdlib.droid.module.user.fragment.BuyRecordFragment;

/**
 * 作者：HQY on 2018/11/6 15:42
 * 邮箱：hqy_xz@126.com
 */

public class MyActivity extends BaseCommonActivity {

    private JumpType mJumpType;


    public static Intent newInstance(Context context, JumpType jumpType) {
        Intent intent = new Intent(context, MyActivity.class);
        intent.putExtra(UIHelper.JUMP_TYPE, jumpType);
        return intent;
    }


    @Override
    protected boolean initBundle(Bundle bundle) {
        mJumpType = (JumpType) getIntent().getSerializableExtra(UIHelper.JUMP_TYPE);
        return true;
    }

    @Override
    protected BaseFragment getFirstFragment() {
        switch (mJumpType) {
            case BUY_RECORD:
                return BuyRecordFragment.newInstance();
            default:
                return null;
        }
    }
}
